/**
 * Copyright &copy; 2013-2016 山东易科德软件有限公司 All rights reserved.
 */
package cn.net.ecode.modules.cms.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.net.ecode.common.persistence.Page;
import cn.net.ecode.common.utils.DateUtils;
import cn.net.ecode.common.utils.StringUtils;
import cn.net.ecode.common.web.BaseController;
import cn.net.ecode.modules.cms.entity.Guestbook;
import cn.net.ecode.modules.cms.entity.Site;
import cn.net.ecode.modules.cms.service.ArticleService;
import cn.net.ecode.modules.cms.service.GuestbookService;
import cn.net.ecode.modules.cms.service.LinkService;
import cn.net.ecode.modules.cms.utils.CmsUtils;

import com.google.common.collect.Maps;

/**
 * 内容管理Controller
 * @author ThinkGem
 * @version 2015-12-1
 */
@Controller
@RequestMapping(value = "${adminPath}/cms")
public class CmsController extends BaseController {

	@Autowired
	private ArticleService articleService;
	@Autowired
	private LinkService linkService;
	@Autowired
	private GuestbookService guestbookService;
	
//	@RequiresPermissions("cms:view")
	@RequestMapping(value = {"index", ""})
	public String index() {
		CmsUtils.getSite(Site.MAIN_SITE_CODE); // 用于初始化站点数据
		return "modules/cms/cmsIndex";
	}
	
//	@RequiresPermissions("cms:view")
	@RequestMapping(value = "view")
	public String view(Model model) {
		model.addAttribute("canAdmin", "false");
		return index();
	}
	
//	@RequiresPermissions("cms:view")
	@RequestMapping(value = "none")
	public String none() {
		return "modules/cms/cmsNone";
	}
	

}
